Sub ClearCmdButton_Click () 'clear out text and list boxes Text1.Text = "" List1.Clear End Sub Sub Command1_Click () LBhWnd% = List1.hWnd 'handle of list box TBhWnd% = Text1.hWnd 'handle of text box VBFhWnd% = Form1.hWnd 'handle of VB form MsgBox "Call Fortran DLL", 64, "Visual Basic" Call TESTMSG(LBhWnd%, TBhWnd%, VBFhWnd%) 'call the fortran dll, 'with 3 handles MsgBox "All done!", 16, "Visual Basic" End Sub Sub OKCmdButton_Click () 'end program End End Sub Sub TestCmdButton_Click () 'this button calls the fortran DLL ClearCmdButton.Enabled = False 'disable all OKCmdButton.Enabled = False 'buttons TestCmdButton.Enabled = False LBhandle% = List1.hWnd 'handle to list box TBhandle% = Text1.hWnd 'handle to text box VBFhandle% = Form1.hWnd 'handle to VB form Label3.Caption = " Program status: in Fortran DLL" 'call Fortan DLL with handles of list,text boxes and VB form Call TESTMSG(LBhandle%, TBhandle%, VBFhandle%) Label3.Caption = " Program status: in VB program" MsgBox "Done!", 16, "VB 3.0" TestCmdButton.Enabled = True 'enable all ClearCmdButton.Enabled = True 'buttons OKCmdButton.Enabled = True End Sub